/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ua.yandex.skipass;

import java.util.Scanner;
import ua.yandex.skipass.SkiPass.PassType;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 *
 * @author Brothers
 */
public class Main {

    public static SkiPass createCase(AccountingSystem base, int k) {
        SkiPass pass = new SkiPass();
        Scanner in = new Scanner(System.in);
        int j;
        int i;
        if (k == 1) {
            pass = base.createSkipass(PassType.Season, k);
            j = in.nextInt();
            pass.setNumberDay(j);
        } else if (k == 2) {
            pass = base.createSkipass(PassType.Work, 0);
            i = in.nextInt();
            j = in.nextInt();
            pass.setDays(j, i);
        } else if (k == 3) {
            pass = base.createSkipass(PassType.Work, 1);
            j = in.nextInt();
            pass.setNumberLift(j);
        }
        return pass;
    }

    public static void main(String[] args) {
        AccountingSystem base = new AccountingSystem();
        base.createTurnstile();
        Calendar data = new GregorianCalendar();
        data.clear();
        Date temporaryDate = new Date();
        data.setTime(temporaryDate);
        base.setDate(data);
        int k = 0;
        Scanner in = new Scanner(System.in);
        while (k != -1) {
            System.out.println("1 - season,2 - day,3 - lift");
            k = in.nextInt();
            base.addPass(createCase(base, k));
        }

    }
}
